﻿<Grid x:Name="TouchFile" x:Class="TouchExplorer.TouchFileDisplay"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
            xmlns:Controls="clr-namespace:TouchExplorer.Controls"
            xmlns:ctrls="clr-namespace:TouchControls;assembly=TouchControls"
            mc:Ignorable="d"  
             d:DesignHeight="300" d:DesignWidth="300">

    <Grid.ColumnDefinitions>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="*"/>
        <ColumnDefinition Width="Auto"/>
        <ColumnDefinition Width="Auto"/>
    </Grid.ColumnDefinitions>
    <Grid.RowDefinitions>
        <RowDefinition Height="*" />
        <RowDefinition Height="5" />
    </Grid.RowDefinitions>
    <Grid Grid.Column="0" Margin="7 3 8 0" VerticalAlignment="Center" HorizontalAlignment="Left">        
        <Image x:Name="ImgElement" Width="40" Height="40" Stretch="UniformToFill" />
        <StackPanel>
            <StackPanel.RenderTransform>
                <TranslateTransform X="-6" Y="-3" />
            </StackPanel.RenderTransform>
            <Image Source="{StaticResource ImgStatusSelected}" Visibility="{Binding IsSelected, Converter={StaticResource BoolToVisibilityConverter}}"  VerticalAlignment="Top" HorizontalAlignment="Left" Width="20" Height="20" Stretch="UniformToFill" />
            <Image Source="{StaticResource ImgStatusCopy}" Visibility="{Binding IsCopyed, Converter={StaticResource BoolToVisibilityConverter}}"  VerticalAlignment="Top" HorizontalAlignment="Left" Width="20" Height="20" Stretch="UniformToFill" />
            <Image Source="{StaticResource ImgStatusCut}" Visibility="{Binding IsCutted, Converter={StaticResource BoolToVisibilityConverter}}"  VerticalAlignment="Top" HorizontalAlignment="Left" Width="20" Height="20" Stretch="UniformToFill" />
        </StackPanel>        
    </Grid>
    <Grid Grid.Column="1" HorizontalAlignment="Stretch" VerticalAlignment="Center">
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />            
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="Auto" />
            <!--<RowDefinition Height="Auto" />-->
        </Grid.RowDefinitions>
        <TextBlock HorizontalAlignment="Stretch" Grid.ColumnSpan="2" Text="{Binding Name, Mode=OneTime}" Style="{StaticResource LargeWhiteText}" />
        <TextBlock Text="{Binding Info.Extension, Mode=OneTime}" Grid.Row="1" HorizontalAlignment="Center" VerticalAlignment="Center" Style="{StaticResource SmallGrayText}" FontSize="14" Margin="0 0 8 0"/>
        <!--<TextBlock HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="1" Text="{Binding Info.FullName, Mode=OneTime}" Style="{StaticResource SmallGrayText}" />-->
        <TextBlock HorizontalAlignment="Stretch" Grid.Column="1" Grid.Row="1" Text="{Binding FileDescription, Mode=OneTime}" Style="{StaticResource SmallGrayText}" />
    </Grid>
    <StackPanel Orientation="Horizontal" Grid.Column="2">
        <ctrls:Tile Style="{StaticResource VerySmallTileButton}" Visibility="{Binding IsFavorite, Converter={StaticResource BoolToVisibilityConverter}}" Content="Fav." Icon="{StaticResource ImgToolbarFavorite}" IconSize="32" Opacity="0.6" Click="BtnFav_Click"/>
    </StackPanel>
    <StackPanel Orientation="Horizontal" Grid.Column="3">
        <ctrls:Tile Style="{StaticResource VerySmallTileButton}" Content="Open" Icon="{StaticResource ImgRunFile}" IconSize="32" Opacity="0.6" Click="BtnStart_Click"/>
    </StackPanel>
    <!--<ctrls:TouchMenu Grid.Column="3" MenuTileSize="80" Margin="5 0 5 0">
        <ctrls:TouchMenuItem Header="Open" MenuTileSize="70" Click="BtnStart_Click" Icon="{StaticResource IcoRun}" />
        <ctrls:TouchMenuItem Header="File" MenuTileSize="70" Icon="{StaticResource IcoFile}">
            <ctrls:TouchMenuItem Header="Copy" Click="TestClick"  Icon="{StaticResource IcoCopy}"/>
            <ctrls:TouchMenuItem Header="Cut" Click="TestClick"  Icon="{StaticResource IcoCut}"/>
            <ctrls:TouchMenuItem Header="Delete" Click="TestClick"  Icon="{StaticResource IcoDelete}"/>
        </ctrls:TouchMenuItem>
    </ctrls:TouchMenu>-->
    <Border Grid.ColumnSpan="4" Grid.Row="1" Background="{StaticResource ListSeparator}" Height="2" VerticalAlignment="Bottom">                
    </Border>
    <Grid.Triggers>
        <EventTrigger RoutedEvent="Grid.Loaded">
            <BeginStoryboard>
                <Storyboard Name="ItemLoad">
                    <DoubleAnimation   
                            Storyboard.TargetProperty="(Grid.Opacity)"   
                            From="0.0" To="1" Duration="0:0:0.3" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
        <EventTrigger RoutedEvent="Grid.Unloaded">
            <BeginStoryboard>
                <Storyboard Name="ItemUnload">
                    <DoubleAnimation   
                            Storyboard.TargetProperty="(Grid.Opacity)"   
                            From="1" To="0" Duration="0:0:0.15" />
                </Storyboard>
            </BeginStoryboard>
        </EventTrigger>
    </Grid.Triggers>
</Grid>

